import OSS from 'ali-oss';
// eslint-disable-next-line
const ossConfig = {
  region: 'oss-cn-beijing',
  accessKeyId: 'LTAI5tArnpucQjSDoACcFgvT',
  accessKeySecret: '8Xh8l9yBichUJJP5SSjuTLUGabcbmF',
  bucket: 'chenyujinshupicture'
};

const client = new OSS(ossConfig);

export async function uploadImgs(name, file) {
  try {
    const result = await client.multipartUpload(name, file);
    return result;
  } catch (error) {
    console.error('Upload failed:', error);
    throw error;
  }
}
